package game.players.cpu.opponent;

import utils.tasks.FinishSweepTask;

import com.uqbar.vainilla.appearances.Sprite;

import game.players.SoccerPlayer;
import game.players.states.WithBallSweepingPlayer;

public class WithBallSweepingCPUOpp extends WithBallSweepingPlayer {
	
	private FinishSweepTask task;

	public WithBallSweepingCPUOpp(SoccerPlayer player, boolean isRight, FinishSweepTask task) {
		super(player, isRight);
		this.setTask(task);
	}
	
	@Override
	protected void setRightSprite() {
		this.getPlayer().setAppearance(Sprite.fromImage("/images/goal3_barrida3.png").scale(1.5));
	}
	
	@Override
	protected void setLeftSprite() {
		this.getPlayer().setAppearance(Sprite.fromImage("/images/goal3_barrida3.png").scale(1.5).flipHorizontally());
	}

	@Override
	public void loseTheBall() {
		this.getTask().cancel();
		this.getPlayer().setState(new BeatenCPUOppPlayer(this.getPlayer(), this.isRight()));
	}
	
	
	
	
	

	public FinishSweepTask getTask() {
		return task;
	}

	public void setTask(FinishSweepTask task) {
		this.task = task;
	}
	
}
